﻿using Gp.Scripts.Core;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

namespace Gp.Scripts.GUI.Reaction {
    public class ReactionUIButton : MonoBehaviour {
        // private ReactionRenderInfo _renderInfo;
        public Button button;
        public TMP_Text titleText;
        public Image icon;
        
        public void RenderSelection<T>(BaseReactionEntity reaction, ReactionWindowController controller,
            T args) where T : ReactionArgs {
            gameObject.SetActive(true);
            var renderInfo = new ReactionRenderInfo();
            
            if (button == null)
                button = GetComponent<Button>();
            icon.sprite = renderInfo.Icon;
            titleText.text = renderInfo.Title;
            
            
            button.onClick.AddListener(() => {
                // controller.OnSelect(wrapper, args);
            });
        }
    }
}